﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Model;
using FairyGUI;
namespace MDFGame
{
    public class CardWindowUI
    {
        private GComponent MainUI;
        public GList gList;
        
        public void Create(GComponent UI)
        {
            MainUI = UI;
            gList = MainUI.GetChild("nList").asList;
        }

        public void ShowWindow(LinkedList<int>CardGID)
        {
            gList.RemoveChildren();
            FieldInfoComponent _temp = GameRoot.Scene.GetComponent<FieldInfoComponent>();
            long _tempEid = -1;
            foreach (int i in CardGID)
            {
                if (_temp.GameCard.TryGetValue(i, out _tempEid))
                {
                    gList.AddChild(GameRoot.allEntities[_tempEid].GetComponent<CardUIComponent>().MainView.MainUI);
                }
            }
        }
        public void ShowWindow()
        {

        }
    }
}
